package eerbaar.client.exp;

public class Numeric implements IExp {

    public static boolean isNumeric(String s) {

        boolean result = false;

        for (int i = 0; i < 10; i++) {
            if (s.equals("" + i)) {
                result = true;
                break;
            }
        }

        return result;
    }

    private final int value;

    public Numeric(String value) {
        this.value = Integer.parseInt(value);
    }

    @Override
    public Object calcDestination(IScope scope) {
        assert (false);
        return null;
    }

    @Override
    public IScope interpret(IScope scope) throws ExpException {
        assert (false);
        return null;
    }

    @Override
    public boolean isInteresting(String elementName) {
        assert (false);
        return false;
    }

    @Override
    public void populateValueArea(IScope scope) {
        //
    }

    @Override
    public String toString() {
        return "" + this.value;
    }

    @Override
    public void updateArea(IScope scope) {
        //
    }

}
